package zoo.cart.admin.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import zoo.cart.admin.dao.CartDao;
import zoo.cart.admin.domain.CartCommand;

@Controller
public class CartUpdateController {

	@Autowired
	private CartDao cartDao;
	
	@ModelAttribute("cartCommand")
	public CartCommand formBacking(){
		return new CartCommand();
	}
	
	@RequestMapping("/admin/cartDetail.do")
	public ModelAndView process(@RequestParam("or_num")int or_num){
				
		CartCommand board = cartDao.selectCart(or_num);

		//줄바꿈 처리
		
		return new ModelAndView("admin_order_detail","board",board);	
		
	}	
}
